The following references are considered to be pertinent for the purpose of understanding the background of the present invention:    [1] S. Cho, Z. Bojkovic, D. Milovanovic, J. Lee, and Hwang, “Image quality evaluation: JPEG2000 versus Intra-only H.264/AVC High Profile”, FACTA UNIVERSITATIS Elec. Energ., vol. 20, no. 1, 71-83 (April 2007)    [2] F. De Simone, M. Ouaret, F. Dufaux, A. G. Tescher, and T. Ebrahimi, “A comparative study of JPEG 2000, AVC/H.264, and HD Photo”, Applications of Digital Image Processing XXX, Proceedings of SPIE, vol. 6696, San Diego, Calif. USA, 28-30, Aug. 2007.    [3] Anthony J Maeder, Birgit M Planitz, “Medical image Watermarking for Multiple Modalities,” aipr, pp. 158-165, 34th Applied Imagery and Pattern Recognition Workshop (AIPR '05), 2005.
Re-compression of digital images such as JPEG images is well known. It is desirable to have a monotonic relationship between the extent of compression and the quality of the compressed image.
U.S. Pat. No. 6,233,359 to Ratnaker et al. describes a technique that reduces the size of an existing JPEG file or set of DCT coefficients to satisfy a certain bit budget by setting to zero coefficients whose magnitude is below a certain threshold and which occur after a certain ordinal number in the zig-zag scan. The cutoff ordinal number is chosen using a clever savings computation strategy. This strategy is implemented by filling appropriate savings values in an array of savings values, Savings[1], . . . , Savings[63]. The value Savings[n] is exactly the number of bits saved by reducing the thresholding cutoff ordinal number from n+1 to n. When a non-zero coefficient is set to zero, bits are saved because two runs of zeros (the one preceding it and the one following it) get combined into a single, longer run of zeros. The exact number of bits saved may be computed by adding the bits needed to code the previous and next runs, and subtracting the bits needed to code the combined run. Some special conditions (runs longer than 16 and end-of-block conditions) need to be carefully factored into the computation.
The disclosures of all publications and patent documents mentioned in the specification, and of the publications and patent documents cited therein directly or indirectly, are hereby incorporated by reference.